import os
from building import *

cwd  = GetCurrentDir()

src      = Glob('infra/erpc_basic_codec.cpp')
src      += Glob('infra/erpc_client_manager.cpp')
src      += Glob('infra/erpc_crc16.cpp')
src      += Glob('infra/erpc_framed_transport.cpp')
src      += Glob('infra/erpc_message_buffer.cpp')
src      += Glob('infra/erpc_message_loggers.cpp')
src      += Glob('infra/erpc_pre_post_action.cpp')
src      += Glob('infra/erpc_server.cpp')
src      += Glob('infra/erpc_simple_server.cpp')

src      += Glob('port/erpc_port_rtthread.cpp')
src      += Glob('port/erpc_serial.cpp')
src      += Glob('port/erpc_threading_rtthread.cpp')

src      += Glob('setup/erpc_client_setup.cpp')
src      += Glob('setup/erpc_setup_mbf_dynamic.cpp')
src      += Glob('setup/erpc_setup_mbf_static.cpp')
src      += Glob('setup/erpc_server_setup.cpp')
src      += Glob('setup/erpc_setup_serial.cpp')
src      += Glob('setup/erpc_setup_tcp.cpp')

src      += Glob('transports/erpc_inter_thread_buffer_transport.cpp')
src      += Glob('transports/erpc_serial_transport.cpp')
src      += Glob('transports/erpc_tcp_transport.cpp')


CPPPATH  = [cwd + '/config']
CPPPATH  += [cwd + '/infra']
CPPPATH  += [cwd + '/port']
CPPPATH  += [cwd + '/setup']
CPPPATH  += [cwd + '/transports']

LOCAL_CCFLAGS = ' -std=c++11'

group = DefineGroup('erpc', src, depend = [''], CPPPATH = CPPPATH, LOCAL_CCFLAGS = LOCAL_CCFLAGS)

Return('group')
